package com.kejiguan.ui.dialog;

import android.content.Context;

import com.kejiguan.ui.R;

/**
 * Created by apple on 16/5/12.
 */
public class AddSheduleDialogUtil {

    private static AddSheduleDialogUtil instance;
    private AddSheduleDialog addSheduleDialog;

    public AddSheduleDialogUtil() {
    }

    public static AddSheduleDialogUtil getInstance() {
        if (instance == null) {
            synchronized (AddSheduleDialogUtil.class) {
                if (instance == null) {
                    instance = new AddSheduleDialogUtil();
                }
            }
        }
        return instance;
    }

    public void show(Context context,AddSheduleDialog.AddSheduleListerner addSheduleListerner)
    {
        if (null == addSheduleDialog || !addSheduleDialog.isShowing())
        {
            addSheduleDialog = new AddSheduleDialog(context, R.style.dialog_tran);
        }
        addSheduleDialog.setAddSheduleListerner(addSheduleListerner);
        addSheduleDialog.show();
        addSheduleDialog.setCanceledOnTouchOutside(true);
    }

    public void dismiss() {
        if (null != addSheduleDialog && addSheduleDialog.isShowing()) {
            addSheduleDialog.dismiss();
        }

    }
}
